package String;

import java.sql.SQLOutput;
import java.util.Arrays;
import java.util.Scanner;

public class D4 {
    public static void main(String[] args) {
//        把数组里面的数据转化成字符串返回
//        例: int[]arr = {1,2,3};    结果:[1,2,3]
        Scanner scanner = new Scanner(System.in);
        System.out.println("键盘输入数组长度:");
        int n = scanner.nextInt();//键盘输入一个数组
        int[] arr = new int[n];//创建数组
        System.out.println("请输入数组中元素大小:");
        for (int i = 0; i < arr.length; i++) {
            arr[i] = scanner.nextInt();//读取元素
        }

        String ret = Arrays.toString(arr);
        System.out.println(ret);
    }
}
